/////////////////////////////////////////////////////////////////////////
////                           			                             ////
////                                                                 ////
//// 															     ////
////                                                                 ////
////                                                                 ////
/////////////////////////////////////////////////////////////////////////
////  															     ////
/////////////////////////////////////////////////////////////////////////

#include <16f877a.h>                    //PIC A UTILIZAR
#fuses xt,nowdt                               //CRISTAL
#use delay(clock=4000000)               //A 4MHZ
#include <glcd.c>
#include <math.h>
                     //INCLUIMOS GLCD.C DE PICC
#USE RS232(BAUD=9600, RCV=PIN_C7, STREAM=COM_A)



BYTE CONST tanque20 [255]={
0xFF,0xFF,0x03,0x03,0x03,0x83,0xC3,0x63,0xB3,0x53,0xB3,
0x53,0xB3,0x53,0xB3,0x53,0xB3,0x53,0xB3,0x53,0xB3,0x53,
0xB3,0x53,0xB3,0x53,0xB3,0xD3,0x73,0xB3,0xF3,0x03,0x03,
0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xF3,
0x53,0xF3,0x03,0xF3,0x03,0x13,0xF3,0x13,0x03,0xF3,0x03,
0xF3,0x03,0xF3,0x53,0xA3,0x03,0xF3,0x53,0xF3,0x03,0x03,
0x03,0xE3,0x13,0x03,0xC3,0x23,0x23,0x03,0xC3,0x23,0x43,
0x23,0xC3,0x03,0x13,0xE3,0x03,0x03,0x03,0x03,0x03,0x03,
0x03,0x03,0x03,0x03,0x03,0xFF,0x03,0x03,0x03,0xF3,0x03,
0xF3,0x03,0xF3,0x13,0xF3,0x03,0xF3,0x03,0x13,0xF3,0x13,
0x03,0x03,0x03,0x03,0xE3,0x13,0x03,0xE3,0x03,0xE3,0x03,
0x13,0xE3,0x03,0x03,0x03,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
0xFF,0xFF,0x06,0x07,0x06,0x07,0x06,0x07,0x06,0x07,0xFE,
0xFF,0x06,0x07,0x06,0x07,0x06,0x07,0x06,0xFF,0xFE,0xAB,
0x55,0xAA,0x55,0xAA,0xFF,0x00,0x00,0xFF,0x04,0x04,0x04,
0x44,0x44,0x74,0x44,0x44,0x04,0x05,0x04,0xC5,0x24,0x25,
0x45,0x04,0xC5,0x24,0x24,0xC5,0x05,0xE5,0x24,0x25,0xC4,
0x05,0x84,0x85,0x04,0x05,0x04,0x04,0x04,0x04,0x05,0x04,
0x04,0x05,0x05,0x04,0x05,0x04,0x04,0x04,0x05,0x04,0x05,
0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
0x04,0xFF,0x04,0x04,0x04,0x04,0x05,0x04,0x04,0x05,0x05,
0x05,0x04,0x05,0x05,0x04,0x05,0x04,0x05,0x04,0x04,0x04,
0x04,0x05,0x04,0x04,0x05,0x04,0x04,0x05,0x04,0x04,0x04,
0x04,0xFF
};



BYTE CONST tanque21 [255]={
0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0xFF,0xAA,0x55,0xAA,0x55,0xAA,0xFF,
0x00,0x00,0xFF,0x00,0x00,0x80,0x41,0x41,0x47,0x41,0x41,
0x80,0x00,0x00,0xC3,0x04,0x04,0xC2,0x00,0xC7,0x01,0x01,
0x47,0x40,0xC7,0x41,0x41,0x00,0x00,0x02,0x02,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0xFF,0xFF,0x0C,0x0C,0xCC,0x4C,0x4C,0xCC,0x0C,
0xEC,0x2F,0x2F,0x2C,0xEC,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,
0xFF,0xAA,0x55,0xAA,0x55,0xAA,0xFF,0x00,0x00,0xFF,0x00,
0x01,0x04,0x02,0x89,0x45,0x49,0x82,0x04,0x01,0x00,0x87,
0x88,0x88,0x07,0x00,0x8F,0x88,0x88,0x00,0x00,0x8F,0x80,
0x80,0x00,0x00,0x05,0x05,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00
};



BYTE CONST tanque22 [255]={
0x00,0xFF,0xFF,0xFF,0x00,0x00,0x3F,0x3F,0x30,
0x34,0x31,0x35,0x31,0x35,0x30,0x35,0x31,0x31,0x31,0x31,
0x30,0x30,0x30,0x30,0x30,0x3F,0x3F,0x2A,0x35,0x1A,0x0D,
0x06,0x03,0x00,0x00,0xFF,0x00,0x00,0x0C,0x1A,0x0B,0x19,
0x19,0x0B,0x1A,0x0C,0x00,0x1F,0x04,0x04,0x03,0x00,0x1F,
0x04,0x04,0x1B,0x00,0x1F,0x12,0x12,0x00,0x00,0x0A,0x0A,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};



BYTE CONST tanque23 [255]={
0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xFF,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xFF,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0
};

BYTE CONST tanque24 [4]={
0xC0,0xC0,0xFF,0xFF
};




















void main() {
 int a;
glcd_init(ON);   // iniciamos la lcd
glcd_fillScreen(OFF); //LIMPIAMOS LA PANTALLA







 for(;;){
//muestra toda la linea 0
glcd_pixel(0,0,off) ;
for (a=1;a<=63;a++){glcd_writeByte(GLCD_CS1,tanque20[a]);}

glcd_pixel(64,0,off) ;
for (a=65;a<=128;a++){glcd_writeByte(GLCD_CS2,tanque20[a]);}

glcd_pixel(0,8,off) ;
for (a=129;a<=191;a++){glcd_writeByte(GLCD_CS1,tanque20[a]);}///////////////

glcd_pixel(64,8,off) ;
for (a=193;a<=254;a++){glcd_writeByte(GLCD_CS2,tanque20[a]);}
glcd_writeByte(GLCD_CS2,tanque20[0]);


//muestra toda la linea 1
glcd_pixel(0,16,off) ;
for (a=2;a<=64;a++){glcd_writeByte(GLCD_CS1,tanque21[a]);}

glcd_pixel(64,16,off) ;
for (a=66;a<=128;a++){glcd_writeByte(GLCD_CS2,tanque21[a]);}

glcd_pixel(0,24,off) ;
for (a=130;a<=192;a++){glcd_writeByte(GLCD_CS1,tanque21[a]);}

glcd_pixel(64,24,off) ;
for (a=194;a<=254;a++){glcd_writeByte(GLCD_CS2,tanque21[a]);}  //mirar
glcd_writeByte(GLCD_CS2,tanque21[0]);
glcd_writeByte(GLCD_CS2,tanque22[1]);



//muestra toda la linea 2

glcd_pixel(0,32,off) ;
for (a=3;a<=65;a++){glcd_writeByte(GLCD_CS1,tanque22[a]);}

glcd_pixel(64,32,off) ;
for (a=67;a<=129;a++){glcd_writeByte(GLCD_CS2,tanque22[a]);}

glcd_pixel(0,40,off) ;
for (a=131;a<=193;a++){glcd_writeByte(GLCD_CS1,tanque22[a]);}

glcd_pixel(64,40,off) ;
for (a=195;a<=254;a++){glcd_writeByte(GLCD_CS2,tanque22[a]);}
glcd_writeByte(GLCD_CS2,tanque23[0]);
glcd_writeByte(GLCD_CS2,tanque23[1]);
glcd_writeByte(GLCD_CS2,tanque23[2]);



//muestra toda la linea 3
glcd_pixel(0,48,off) ;
for (a=4;a<=66;a++){glcd_writeByte(GLCD_CS1,tanque23[a]);}

glcd_pixel(64,48,off) ;
for (a=68;a<=130;a++){glcd_writeByte(GLCD_CS2,tanque23[a]);}

glcd_pixel(0,56,off) ;
for (a=132;a<=194;a++){glcd_writeByte(GLCD_CS1,tanque23[a]);}

glcd_pixel(64,56,off) ;
for (a=196;a<=254;a++){glcd_writeByte(GLCD_CS2,tanque23[a]);}
for (a=0;a<=3;a++){glcd_writeByte(GLCD_CS2,tanque24[a]);}

/*
glcd_pixel(64,0,on) ;
glcd_pixel(64,1,on) ;
glcd_pixel(64,9,off) ;
glcd_pixel(64,11,off) ;
glcd_pixel(64,12,off) ;
glcd_pixel(64,13,off) ;
glcd_pixel(64,14,off) ;
glcd_pixel(64,15,off) ;
glcd_pixel(64,62,on) ;
glcd_pixel(64,63,on) ;

glcd_line(0,0,1,63,on) ;
glcd_line(0,63,1,0,on) ;*/

fin:
goto fin;


}
}
